package com.bwie.service.impl;

import com.bwie.mapper.RuleTypeMapper;
import com.bwie.pojo.RuleType;
import com.bwie.service.RuleTypeService;
import com.bwie.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author GaoYiJie
 * @Description
 * @Create 2025/2/27 11:05
 * @Version 1.0
 */
@Service
public class RuleTypeServiceImpl implements RuleTypeService {

    @Autowired
    RuleTypeMapper ruleTypeMapper;

    @Override
    public R getRuleTypeList() {
        List<RuleType> ruleTypes = ruleTypeMapper.selectList(null);
        return R.OK(ruleTypes);
    }

    @Override
    public R addRule(RuleType ruleType) {
        ruleTypeMapper.insert(ruleType);
        return R.OK();
    }
}
